package com.xianjindai.facade.utils;

import java.util.Date;
import java.util.Random;

import com.xianjindai.commons.utils.DateUtils;


public class RandomUtil {
	private static final String PRE_BORROWNO = "信用-ZZSD";
	private static final String FORMAT_STR = "yyMMdd";
	private RandomUtil(){
		
	}
	
	/**
	 * 生成借款单号：速贷集+当前年月日+四位随机数
	 * 
	 * @return
	 */
	public static String getRandomBorrowNo() {
		
		Random random = new Random();
		int rannum = (int) (random.nextDouble() * (9999 - 1000 + 1)) + 1000;// 获取4位随机数

		return PRE_BORROWNO + DateUtils.formatDate(new Date(), FORMAT_STR) + rannum;
	}
}